import { defineComponent } from "vue";
import style from "./index.module.less";
import BrandInfo from "@/components/BrandInfo";
import CardView from "@/components/CardView";
import InfoCellGray from "@/components/InfoCellGray";
import TextView from "@/components/TextView";
import RoundEdgeButtonGroup from "@/components/RoundEdgeButtonGroup";
import { ILabelGroupProps } from "@/components/LabelGroup/types";
import { ILabelProps } from "@/components/Label/types";
import DemoPage from "@/components/DemoPage";
import ExperienceCell from "@/components/ExperienceCell";
import { IButtonGroupViewData } from "@/components/ButtonGroupView/types";
import InfoCell from "@/components/InfoCell";
import AgriculturalTechnologyCell from "@/components/AgriculturalTechnologyCell";
import RoundInfo from "@/components/RoundInfo";
import ExpertCell from "@/components/ExpertCell";
import DetailedInfo from "@/components/DetailedInfo";
export default defineComponent({
  name: "",
  setup() {
    const getData1 = () => {
      return {
        labels: [
          {
            name: "品牌",
            type: "yellow",
          },
        ] as ILabelProps[],
        types: [
          {
            name: "水果、蔬菜类别可使用",
            type: "blue",
          },
        ] as ILabelProps[],
        text: "此此此此时正值春耕农忙时节，而在农业部…",
        desc: "镇海区九龙湖镇农基站",
        title: "宁波市镇海国振果业合作社",
        src: "https://img0.baidu.com/it/u=455228103,934359577&fm=253&app=138&size=w931&n=0&f=JPEG&fmt=auto?sec=1680368400&t=6b05b5956619173cd55195675ed50d87",
      };
    };
    const render1 = () => {
      const data = getData1();
      return (
        <BrandInfo
          title={data.title}
          text={data.text}
          desc={data.desc}
          labels={data.labels}
          types={data.types}
          src={data.src}
        />
      );
    };
    const render2 = () => {
      const data = getData1();
      return (
        <BrandInfo
          title={data.title}
          text={data.text}
          desc={data.desc}
          labels={data.labels}
          types={data.types}
          type="edit"
          src={data.src}
        />
      );
    };
    const render3 = () => {
      const data = getData1();
      const buttons = [
        {
          text: "拒绝",
        },
        {
          text: "同意申请",
        },
      ];
      return (
        <InfoCellGray {...data}>
          <TextView>主营业务：水果、蔬菜</TextView>
          <RoundEdgeButtonGroup data={buttons} />
        </InfoCellGray>
      );
    };
    const render4 = () => {
      const data = getData1();
      const buttons = [
        {
          text: "拒绝",
        },
        {
          text: "同意申请",
        },
      ];
      return (
        <InfoCellGray
          {...data}
          right={() => <span class="text-[#F16A39]">面议</span>}
        >
          <TextView>主营业务：水果、蔬菜</TextView>
          <RoundEdgeButtonGroup data={buttons} />
        </InfoCellGray>
      );
    };
    const render5 = () => {
      return (
        <ExperienceCell
          time="时间：2022/11/11 13:30:00"
          title="水果番茄种植技术线下培训"
          text="已参与"
          type="primary"
        />
      );
    };
    const render6 = () => {
      const data = getData1();
      const buttons: IButtonGroupViewData[] = [
        {
          text: "联系大户",
          type: "primary",
        },
      ];
      return (
        <InfoCellGray {...data} src="">
          <TextView>主营业务：水果、蔬菜</TextView>
          <RoundEdgeButtonGroup data={buttons} />
        </InfoCellGray>
      );
    };
    const render7 = () => {
      const data = getData1();
      return <InfoCell {...data} class="seed-item" />;
    };
    const render8 = () => {
      const data = getData1();
      return <AgriculturalTechnologyCell {...data} />;
    };
    const render9 = () => {
      return (
        <RoundInfo
          src="https://img0.baidu.com/it/u=1684532727,1424929765&fm=253&app=120&size=w931&n=0&f=JPEG&fmt=auto?sec=1680368400&t=35762c76e21d1ab3496784bb3f8c196f"
          title="测试"
          text="aaa"
        />
      );
    };
    const render10 = () => {
      const data = getData1();
      return <ExpertCell labels={data.labels} src={data.src} title="李永恒" />;
    };
    const render11 = () => {
      const data = getData1();
      return (
        <DetailedInfo
          {...data}
          distance={"1.7"}
          text="宁波市镇海国振果蔬专业合作社成立于2012年05月07日 于镇海区九龙湖镇田顾工业区,法定代表代人为吴国1范…"
        />
      );
    };
    return () => {
      const data = [
        {
          title: "品牌默认显示",
          view: render1,
        },
        {
          title: "品牌去掉按钮跟电话",
          view: render2,
        },
        {
          title: "带底部灰色条",
          view: render3,
        },
        {
          title: "带底部灰色条-不显示图标",
          view: render6,
        },
        {
          title: "种子item",
          view: render7,
        },
        {
          title: "农技item",
          view: render8,
        },
        {
          title: "圆角带文字",
          view: render9,
        },
        {
          title: "专家",
          view: render10,
        },
        {
          title: "详情信息",
          view: render11,
        },
        {
          title: "自定义右边文字",
          view: render4,
        },
        {
          title: "简单文字1",
          view: render5,
        },
      ];
      return <DemoPage data={data} />;
    };
  },
});
7;
